public with sharing class GalleryviewDemoController {

    private String wallpaperPsId = '72157605600725406';
    public String keywords{get;set;}
    
    public Flickr fc{get;set;}
    public List<Flickr.Photo> photos{get;set;}
    
    public GalleryviewDemoController(){
        fc = new Flickr();
        
        keywords = ApexPages.currentPage().getParameters().get('keywords');
        
        if(keywords==null)
        	photos = fc.getPhotosByPhotoSet(wallpaperPsId);
        else
        	photos =  fc.photoSearch(keywords);
    }
    
    public PageReference search(){
    	PageReference pr = System.Page.GalleryviewDemo;
    	pr.getParameters().put('keywords',keywords);
    	pr.setRedirect(true);
    	
    	return pr;    	
    }

}